package com.cc.jdkjucdemo.optional.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Optional;

@Data
@NoArgsConstructor
public class User {
    String name;

    String fullName;

    public User(String name, String fullName) {
        System.out.println("User created ：" + fullName);
        this.name = name;
        this.fullName = fullName;
    }

    public Optional<String> getFullName2() {
        return Optional.ofNullable(fullName);
    }
}
